home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / maximus / cdcar202.zip / CDCAR.CMD < prev    next >
OS/2 REXX Batch file  |  1994-06-12  |  22KB  |  38 lines

  1. /*                         CD Carousel Door                                */  ;/*                                v2.02                                    */  ;/*                         by Bill Esposito                                */;/*                       The Cereal Port BBS                               */;/*                            1:132/152                                    */;/*                          (603)899-3335                                  */;/*                                                                         */;/*                         Magic name 'CDCAR'                              */;/*                         for latest version                              */;/*                                                                         */;/* *********************************************************************** */;/* DISCLAIMER:  This software is provided "AS IS" without any warranty of  */;/* any kind, either expressed or implied.  USE IT AT YOUR OWN RISK.        */;/*                                                                         */;/* Copyright 1993 by Bill Esposito.  This program is SHAREWARE.    Please  */;/* read the file SHAREWRE.TXT included in this archive.                    */;/* *********************************************************************** */;/*                      *****  CDCAR.CMD  *****                            */;/* The CD Carousel Door program.                                           */;/***************************************************************************/
  2. signal on HALT NAME menu;Arg configdir ansi me user;ver='v2.02';if key = '' then key = '%';'@echo off';config=configdir''cdcar.cfg;f=1;do until lines(config)=0;  param.f=linein(config);  f=f+1;end;ok=stream(config,c,'close');parse var param.1 disk junk;parse var param.2 menutype junk;parse var param.3 homedir junk;parse var param.4 maxdir junk;parse var param.5 download junk;parse var param.6 fnum junk;parse var param.7 type junk;parse var param.8 marea junk
  3. parse var param.9 tnode junk;parse var param.10 fnode junk;parse var param.11 sysopfirst sysoplast junk;parse var param.12 stype junk;parse var param.13 smarea junk;parse var param.15 pl junk;parse var param.17 standalone junk;/* parse var param.18 defaultcd junk */;configcd=configdir''cdcar.cfg;f=1;do until lines(configcd)=0;  if f > 17 then default.f=linein(configcd);  else scrap=linein(configcd);  f=f+1;end;cdes=f-17;if cdes=1 then cdes=2;ok=stream(config,c,'close');sys=configdir''cdcar.sys;f=1
  4. do until lines(sys)=0;  sysparam.f=linein(sys);  f=f+1;end;ok=stream(sys,c,'close');parse var sysparam.1 priv;parse var sysparam.2 key1;parse var sysparam.3 key2;parse var sysparam.4 key3;parse var sysparam.5 key4;parse var sysparam.6 key5;parse var sysparam.7 key6;parse var sysparam.8 key7;parse var sysparam.9 key8;if key='' then key='%';reqflag='0';if ansi=2 then ansi = 0;parse var user first2 mid2 last2;nmi='NO';alias='NO'
  5. if last2='' then do; nmi='YES'; first=first2; last=mid2; mid='';end;if mid2='' then do; alias='YES'; first=first2; last=''; mid='';end;if nmi='NO' then do; first=first2; mid=mid2; last=last2;end  ;grn='';yel='';red=''
  6. blu='';cyan='';brt='';gry=')';lo='';if ansi=1 then do;        grn='';        yel='';        red='';        blu='';        cyan='';        brt='';        gry='';        lo='';end;o=1;;call RxFuncAdd 'SysloadFuncs','RexxUtil','Sysloadfuncs';call sysloadfuncs;file=homedir'disk.lst'
  7. do until lines(file)=0;parse upper value linein(file) with level loc disks diskdesc ;parse upper var disk disku ;if disks=disku then signal done;end;done:;menu:;signal on HALT NAME menu; if ansi=1 then if menutype=0 then do;say'HOS/2OS/2OS/2OS/2OS/2';say'1HOS/2OS/2OS/2OS/2OS/2OS/2OS';say'7H/2OS/2OS/2OS/2OS/2OS/2OS/2OS';say'5H/2OS/2HS   0HOH/H'  ;say'0HCD Carousel Door0HSH25H'ver'0H/';say'HO0HBy Bill Esposito0H2HS9H**' ;say'2HUNREGISTERED5H**0HOH/1H';say'1H 4H    9H                    0HSH2';say'1HThe Selected CD is: 'disk'     0H/HO';say'9H                 0H21HS3H'        ;say'11H                   Change CD40H  80HO'
  8. say'1H/80HS1H228H  File Area Selec';say'45Ht       80H/1HO80H21HS';say'28H  Search by Filename/Text80HO1H/80HS';say'1H228H  Bulletins               65H  ';say'80H/1HO80H21HS26H' ;say'27H   ?Help            63H  80HO';say'1H/80HS1H230HQuit back to BBS';say'80H/1HO31H         80H21HS';say'28H              80HO1H/2OS/2O';say'8HS/2OS/2OS/2OS/2OS/2OS/2OS/2';say'35HOS/2OS/2OS/2OS/2OS/2OS/2';say'59HOS/2OS/2OS/2OS/2OS/2OS';say'1H';; end;  ;  if ansi='0' then if menutype=0 then do;        '@cls';        say 'OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2';        say                                                            
  9.         say '                             CD Carousel Door ';        say '                                  'ver       ;        say '                             By Bill Esposito';        say '                             * UnRegistered *';        say ;        say '  The Currently Selected CD is: 'disk;        say ;        say '                             C)hange Disk';        say                               ;        say '                             F)ile Area   ' ;        say ;        say '                             S)earch by Filename/Text';        say ;        say '                             B)ulletins ';        say;        say '                             ?)Help' ;        say                             ;        say '                             Q)uit Back to BBS';        say ;        say 'OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2'
  10.   end   ;;if menutype=1 then do;  say;  say brt||yel'  CD Carousel Door: 'red||disk;  say;  say brt||yel||'C'gry'hange disk          'brt||yel'F'gry'ile area Select    'brt||yel'S'gry'earch by Filename/Text'    ;  say brt||yel'B'gry'ulletins            'brt||yel'Q'gry'uit to main        'brt||yel'?'gry'Help' ;end;pull sel;if sel = 'B' then call bull;if sel = '?' then call help;if sel='C' then call change_disk;if sel='C' then call menu;if sel ='F'  then call filearealst;if reqflag=1 then do;  if sel = 'Q' then call quit;end;  if def=1 then if sel = 'Q' then call quit;  if sel = 'Q' then call quit1
  11.   if sel ='S'  then call find;signal menu;;/* file area list */;filearealst:;close=stream(file,c,'close');more = 1;file=homedir''disk'\names.lst';'@cls';;/* Read */;read: ;x=1;y='1';open=stream(file,c,'open');;linein(file,1,0) ;;loop2:;if more <> 3 then '@cls'
  12. name.=0                        ;do i=1 to 20;  xx=right(x,2);  if sel='F' then do;    parse value linein(file) with name5 fuldir dirdesc;    dirdesc=strip(dirdesc);    name.i=xx'.  'left(name5,10) dirdesc;    fulldir.i=fuldir;  end  ;  if sel<>'F' then if sel <>'B' then if sel <>'?' then if sel <> 'C' then do;     parse value linein(file) with disks diskdesc;     name.i= xx'.  'disks' 'strip(diskdesc);  end    ;  else if sel<>'F' then if sel <>'B' then if sel <>'?' then do;     parse value linein(file) with level loc disks diskdesc ;     if me=1 then key = '%';     if me=1 then loc = '%';     if me=1 then priv = 10;     if pl=1 then key = '%';     if pl=1 then loc = '%'
  13.      if pl=1 then priv = 10;     if priv < level  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key1  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key2  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key3  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key4  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key5  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key6  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key7  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if loc <> key8  then name.i= level loc xx'.  CDROM Not Available at your access level.';     if priv >= level then if loc = key1 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = key2 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = key3 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = key4 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = key5 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = key6 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = key7 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = key8 then name.i= level loc xx'.  'disks' 'strip(diskdesc);     if priv >= level then if loc = '%' then name.i= level loc xx'.  'disks' 'strip(diskdesc);  end
  14.   if sel = 'B' then name.i = linein(file);  se=0;  if more=3 then do;  parse var name.i level loc number nam diskdesc;  name.i = level loc right(number,3) nam diskdesc;end  ;    if sel='F' then do;      parse var name.i num name5 dirdesc;    dirdesc=strip(dirdesc);      say brt||yel||right(num,3)||grn||left(name5,10) cyan||dirdesc;    end;    if sel <>'F' then if sel <> 'B' then if sel <> '?' then if sel <> 'C' then do;       name.i=left(name.i,79);      parse var name.i num fn sz dt dc;      say brt||red||right(num,3)||yel||left(fn,13)||red||right(sz,8)||grn||right(dt,9)'  'cyan||left(dc,44);    end;    if sel = 'C' then do;       ast='  ';       name.i=left(name.i,79);       parse var name.i level loc num disk6 diskdesc
  15.    u=1;   paramno=17;   do until u = cdes;       paramno=paramno+1;       parse upper var default.paramno dcd3 junk;       parse upper var disk6 curcd1 junk;       if dcd3=curcd1 then ast=' *';       u=u+1;   end    ;       say brt||red||right(num,3)||yel||left(disk6,10)||grn||ast||cyan||strip(diskdesc);    end; ;   if sel = 'B' then say brt||cyan||name.i;  if more=0 then if lines(file)=''0'' then signal more;  if more=1 then if lines(file)=''0'' then signal more;  if more=2 then if lines(file)=''0'' then signal more;    if more=3 then do;      if lines(file)=''0'' then call more;      if lines(file)=''0''then return;    end
  16.   if lines(file)=''0'' then signal qdel;  x=x+y;end;more:;  x=1;   say ;   ;   if more=1 then do;     if lines(file)<>0 then say 'More, Select file area? (Y,n,area#)';     if lines(file)=0 then say  'Select file area? (N,area#)';   end  ;   ;   if more=0 then do;     say 'More? (Y,n)';   end;   ;   if more=2 then do;     if lines(file)<>0 then say 'More, File# ? (Y,n,#)';     if lines(file)=0 then say  'File# ? (N,#)';   end
  17.      ;   if more=3 then do;     if lines(file)<>0 then say 'More, Select Disk? (Y,n,q,disk#)';     if lines(file)=0 then say  'Select Disk? (N,q,disk#)';   end;     ;    pull yn;    ;    if yn='N' then signal qdel;    if yn='Q' then signal qdel;    if more=2 then do;      dt=datatype(yn);      if dt='NUM' then call tagger;    end  ;    if yn='Y' then if fs=1 then return ;    if yn='Y' then if fs <>1 then signal loop2;       if yn='' then do ;      if lines(file)=0 then signal qdel;      signal loop2;    end
  18.     dt= datatype(yn);    if dt='NUM' then if yn > i then yn=1;    if more=1 then if dt='NUM' then call areasel;    if more=3 then do;      if dt<>'NUM' then yn=1;      if dt='NUM' then return;    end  ;    if lines(file)=''0'' then return;if fs=1 then return;signal loop2;qdel:;close=stream(file,c,'close');signal menu;;more1:;say 'more? (Y,n)';pull yn;if yn="N" then signal menu;count = 0;return
  19. ;tagger:;tag=yn;name3=name.tag;parse var name3 num filename date time desc;if filename <>'' then do;   call sysfiletree homedir'*.req', 'file.', 'F';   if file.0=0 then firstime=1;   u=1;   paramno=17;   do while u < cdes;       paramno=paramno+1;       parse upper var default.paramno dcd2 junk;       parse upper var disk curcd;       if dcd2=curcd then dcd=curcd;       u=u+1;   end    ;     if dcd=curcd then do;       call lineout homedir''disk'.def',nmi alias user level loc fulldirectory filename date time desc;       ok=stream(homedir''disk'.def',c,'close')
  20.        def=1;     end;   else do;   call lineout homedir''disk'.req',nmi alias user level loc fulldirectory filename date time desc;    ok=stream(homedir''disk'.req',c,'close');    reqflag=1;   end ;end   ;call more;return;;areasel:;name2=name.yn;fulldirectory=fulldir.yn;parse var name2 num areaname1 rest;areaname=strip(areaname1);file=homedir''disk'\'areaname'.bbs';more=2;sel='';call read
  21. return;;change_disk:;file=homedir'disk.lst';more=3;call dmenu;call read;name4=name.yn;parse var name4 level loc num disk1 cdrom;disk=strip(disk1);if disk = 'CDROM' then do;say 'You do not have access to that disk, please select another';say 'Press <ENTER> to continue';pull;end;if disk = 'CDROM' then signal change_disk;return;;bull:;more=0
  22. file=homedir'cdbull.txt';call read;return;;help:;more=0;file=homedir'cdhelp.txt';sel = 'B';call read;return;;dmenu:;  if ansi=0 then do;        '@cls';        say;        say;        say;        say             ;        say '                             CD Carousel Door';        say '                                  'ver
  23.         say '                             By Bill Esposito';        say;        say ;        say 'The Currently Selected CD is: 'disk;        say ;        say 'Note: CD'"'"'s marked with an * are on-line.';        say;  end;  ;  if ansi=1 then do;        '@cls';        say;        say;        say;        say;        say '                             CD Carousel Door';        say '                                  'ver;        say '                             by Bill Esposito';        say;        say '  '
  24.         say 'The Currently Selected CD is: 'disk;        say '';        say red'Note:'cyan' CD'"'"'s marked with an 'grn'*'cyan' are on-line.';        say;  end;return;find:;notfound=0;more=4;count=0;i=0;'@cls';say;say;say;say;;if ansi=1 then say 'Enter Filename or search string? (any text or numbers, no wildcards)';if ansi=0 then say 'Enter Filename or search string? (any text or numbers, NO WILDCARDS)';say
  25. pull what;if what='' then signal menu;file=homedir''disk'\names.lst';loop3:;more=4;fs=1;z=1;do until z=40;linein(file,1,0) ;;do until lines(file)=0;  parse value linein(file) with drr fulldirectory dirdesc;  drrr=homedir''disk'\'drr'.bbs';  file.='';areaname=drr;say brt||cyan'Directory: 'drr;    ok=sysfilesearch(what, drrr, 'file.');;read1: ;x=1
  26. y='1';name.0=0;  do i=1 to file.0    ;  if file.i<>'' then do;  xx=right(x,2);  name.i= xx'.  'file.i;  if left(file.i,5) <>'FILE.' then do;      name.i=left(name.i,79);      parse var name.i num fn sz dt dc;      say brt||red||right(num,3)||yel||left(fn,13)||red||right(sz,8)||grn||right(dt,9)||cyan'  'dc;  end;  if left(file.i,5) <>'FILE.' then notfound=1;  if datatype(i/20,'W')=1 then call tag;end;x=x+y;end;if file.0 <>0 then call tag;z=z+y;end;if lines(file)<>0 then call loop3
  27. ok=stream(file,c,'close');if notfound=0 then do;  say ' Sorry, unable to find 'WHAT;  say ' Press <ENTER> to continue';  pull ent;end  ;;signal menu;;quit:;file=homedir'disk.lst';  if ansi=0 then do;        '@cls';        say '                             CD Carousel Door';        say '                                  'ver;        say '                             By Bill Esposito';        say;  end;  ;  if ansi = 1 then do
  28.         '@cls';        say '                             CD Carousel Door';        say '                                  'ver;        say '                             by Bill Esposito';        say '' ;  end;if reqflag=1 then do;say First',';say '     You have requested the following files.  You will receive a';say 'message for each sucessfully filled file request.  Please K)ill';say 'these messages upon receipt.  When posted, your files can be found';say 'for download in File Area 'fnum'.';say;   ok=stream(file,c,'close');do until lines(file)=0;   parse value linein(file) with priv lock disk1 diskdesc;   disk=homedir''disk1'.req';   ok=stream(disk,c,'close');   x=8;   request=yes
  29.    dsk=no;      do until lines(disk)=0;         request=no;         if nmi='NO' then if alias='NO' then do;             parse value linein(disk) with nmi1 alias1 first1 mid1 last1 priv lock directory filename sz dt desc;         end    ;         if nmi='YES' then if alias='NO' then do;             parse value linein(disk) with nmi1 alias1 first1 last1 priv lock directory filename sz dt desc;             mid1=mid;         end    ;         if alias='YES' then do;             parse value linein(disk) with nmi1 alias1 first1 priv lock directory filename sz dt desc;             mid1=mid;             last1='';         end    ;         ;         if x=20 then say;         if x=20 then say 'Press <ENTER> to continue';         if x=20 then pull ak         ;         if x=20 then x=8
  30.          if first1=first then if mid1=mid then if last1=last then do;             if dsk=no then say;             if dsk=no then say 'CD: 'disk1'';             dsk=yes;             say left(filename,12) desc;             request=yes;             req=yes;         end    ;         x=x+1;       end;   end;ok=stream(file,c,'close');say;if def = 1 then say 'The files you selected from the On-Line CD'"'"'s (*) are available 'brt||red'now'cyan' from File';if def = 1 then say 'Area 'fnum'.';end;if reqflag <> 1 then if def = 1 then do;h=1;;say first','
  31. say;say '    The files you selected from the On-Line CD'"'"'s (*) are available 'brt||red'now'cyan' from File Area 'fnum'.';end;say;say 'Press <ENTER> to continue';pull ak        ;call msg;quit1:;'@cls';file=homedir'disk.lst';do until lines(file)=0;   parse value linein(file) with disk1 diskdesc;   ok=stream(homedir''strip(disk1)'\names.lst',c,'close');end ;ok=stream(file,c,'close');if def=1 then do;  siz=length(homedir);  homedi=left(homedir,siz-1);  drive=left(homedir,2);  drive
  32.   '@cd' homedi;  call cdmaint.cmd 0 1;end;if me=1 then call cdmenu.cmd;exit;;;tag:      ;     if lines(file)<>0 then say 'More, File# ? (Y,n,#)';     if lines(file)=0 then say  'File# ? (N,#)';    pull yn;    ;    if yn='N' then signal qdel;    dt=datatype(yn);    if dt='NUM' then do;        tag=yn;        name3=name.tag;        parse var name3 num filename date time desc;        if filename <>'' then do;        call sysfiletree homedir'*.req', 'file.', 'F'
  33.         if file.0=0 then firstime=1;;   u=1;   paramno=17;   do while u < cdes;       paramno=paramno+1;       parse upper var default.paramno dcd2 junk;       parse upper var disk curcd;       if dcd2=curcd then dcd=curcd;       u=u+1;   end    ;     if dcd=curcd then do;         call lineout homedir''disk'.def',nmi alias user level loc fulldirectory filename date time desc;         def=1;     end;       else do;        call lineout homedir''disk'.req',nmi alias user level loc fulldirectory filename date time desc;        ok=stream(homedir''disk'.req',c,'close');        reqflag=1;       end 
  34.      end;    end   ;    if yn='' then do ;      if lines(file)=0 then signal qdel;        return;      end;    if yn='Y' then do ;      if lines(file)=0 then signal qdel;        return;     end;call tag;         k=stream(homedir''disk'.def',c,'close');        ok=stream(homedir''disk'.req',c,'close');return;msg:;if standalone = 1 then return;if req=yes then if firstime = 1 then do;  /* MSGAPI */;address CMD 'rxsubcom drop msgapi';address CMD 'rxsubcom register MSGAPI rxmsgapi RXMSGAPI'
  35. address CMD 'rxsubcom load MSGAPI RXMSGAPI';address MSGAPI;'OPEN_API 3 0';'OPEN_AREA MSG 'smarea' MSGAREA_NORMAL 'STYPE;'LOCK MSG';'OPEN_MSG MSGH MSG MOPEN_CREATE 0';cr = '0d'x;text = 'Hello 'SYSOPFIRST',' cr cr 'A User has requested a file from an off-line CD.  Please run CDMenu at your' cr 'earliest convenience.' cr cr '  Thank you,' cr '    CD Carousel' cr cr cr '--- This File was brought to you by CD Carousel'cr      ;controla = '01'x;control = controla || 'PID RXMSGAPI';xmsg.attr = 1;xmsg.from = CD Carousel;xmsg.to = SYSOPFIRST SYSOPLAST;xmsg.subj = 'File Request';xmsg.orig = tnode;xmsg.dest = fnode;hour=time('N');date2=date('S');year=left(date2,4);month=substr(date2,5,2)
  36. day=right(date2,2);date1=year'/'month'/'day':'hour;xmsg.date_written = date1;xmsg.date_arrived = date1;xmsg.utc_ofs = 60;xmsg.replyto = 0;xmsg.replies.1 = 0;xmsg.replies.2 = 0;xmsg.replies.3 = 0;xmsg.replies.4 = 0;xmsg.replies.5 = 0;xmsg.replies.6 = 0;xmsg.replies.7 = 0;xmsg.replies.8 = 0;xmsg.replies.9 = 0;xmsg.replies.10 = 0;xmsg.ftsc_date = date('N') time('N');'WRITE_MSG MSGH 0 XMSG. TEXT' length(text) length(text) length(control) 'CONTROL';'CLOSE_MSG MSGH';'UNLOCK MSG'
  37. 'CLOSE_AREA MSG';'CLOSE_API';address CMD 'rxsubcom drop msgapi';call syssleep 3;end;return;IN.727;IN.728;IN.729;IN.730;IN.731;IN.732;IN.733;IN.734;IN.735;IN.736;IN.737;IN.738;IN.739;IN.740
  38.